// GPSwSmartPhoneView.h : interface of the CGPSwSmartPhoneView class
//


#include "GPScomm.h"
#include "MainFrm.h"
#pragma once

#define ID_STARTBUTTON 1000
#define ID_STOPBUTTON 1001
#define ID_COORDINATES 1002

#define ID_GPSCOUNT 2000
#define ID_GPSCAPTION 2001

class CGPSwSmartPhoneView : public CView
{
protected: // create from serialization only
	CGPSwSmartPhoneView();
	DECLARE_DYNCREATE(CGPSwSmartPhoneView)

// Attributes
public:
	CGPSwSmartPhoneDoc* GetDocument() const;

// Operations
public:

// Overrides
public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);

protected:

// Implementation
public:
	virtual ~CGPSwSmartPhoneView();
#ifdef _DEBUG
	virtual void AssertValid() const;
#endif
	void OnInitialUpdate();

protected:

// Generated message map functions
protected:
	DECLARE_MESSAGE_MAP()

// UI Widgets and associated functions
private:
	CButton startButton;	//Tap to start GPS Collection
	CButton stopButton;		//Tap to stop GPS Collection
	CStatic GPSCaption;		//Just says "Number of GPS: "
	CStatic GPSCount;		//Shows the number of GPSes currently connected.
	CButton GPSButton;		//Click to launch GPS Device Picker Dialog

	afx_msg void onStartButtonClick();
	afx_msg void onStopButtonClick();
	afx_msg void onGPSButtonClick();

	afx_msg void onMenuPickGPSDevices();

public:
	afx_msg LRESULT onGPSAdded(WPARAM, LPARAM);
	afx_msg LRESULT onGPSRemoved(WPARAM, LPARAM);

//Thread Handles and Controllers
private:
	CWinThread * dataCollectThread;
	CWinThread * networkListenerThread;

public:
	GPScomm * bob;
	afx_msg void OnMenuSetserveraddress();
};
	UINT dataCollectionThreadController( LPVOID pParam );
#ifndef _DEBUG  // debug version in GPSwSmartPhoneView.cpp
inline CGPSwSmartPhoneDoc* CGPSwSmartPhoneView::GetDocument() const
   { return reinterpret_cast<CGPSwSmartPhoneDoc*>(m_pDocument); }
#endif

